翻訳と辞書
Words near each other
・ Reena Roy
・ Reena Saini Kallat
・ Reenard
・ Reenat Fauzia
・ Reencarnación
・ Reencontro com Sambalanço Trio
・ Reencuentro
・ Reencuentro con la gloria
・ Reencuentros
・ Reender Kranenborg
・ Reengineering
・ Reengus
・ Reenie Mansata
・ Reentrancy (computing)
・ Reentrant
Reentrant mutex
・ Reentrant superconductivity
・ Reentrant tuning
・ Reentry (disambiguation)
・ Reentry (neural circuitry)
・ Reentry Breakup Recorder
・ Reentry capsule
・ Reenu Mathews
・ Reenu-Rew
・ Reep
・ Reep Daggle
・ REEP1
・ REEP2
・ REEP5
・ Reeperbahn


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Reentrant mutex : ウィキペディア英語版
Reentrant mutex

In computer science, the reentrant mutex (recursive mutex, recursive lock) is particular type of mutual exclusion (mutex) device that may be locked multiple times by the same process/thread, without causing a deadlock.
While any attempt to perform the "lock" operation on an ordinary mutex (lock) would either fail or block when the mutex is already locked, on a recursive mutex this operation will succeed if and only if the locking thread is the one that already holds the lock. Typically, a recursive mutex tracks the number of times it has been locked, and requires equally many unlock operations to be performed before other threads may lock it.
==Motivation==
Recursive mutexes solve the problem of non-reentrancy with regular mutexes: if a function that takes a lock and executes a callback is itself called by the callback, deadlock ensues. In pseudocode, that is the following situation:
var m : Mutex // A non-recursive mutex, initially unlocked.

function lock_and_call(i : Integer)
m.lock()
callback(i)
m.unlock()

function callback(i : Integer)
if i > 0
lock_and_call(i - 1)
Given these definitions, the function call will cause the following sequence of events:
* — mutex locked
*
* — because
* — deadlock, because is already locked, so the executing thread will block, waiting for itself.
Replacing the mutex with a recursive one solves the problem, because the final will succeed without blocking.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Reentrant mutex」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.